package twelfth.字节流与字符流基本操作.字符流.Writer;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

public class 使用FileWriter追加文件的内容 {
    public static void main(String[] args) throws IOException {
        // 找到操作文件
        String path = "D:" + File.separator + "WorkSpaces" + File.separator +
                "JavaDevelopBase_start_329" + File.separator + "src" + File.separator +
                "twelfth" + File.separator + "WriterDemo.txt";
        File f = new File(path);
        Writer writer = new FileWriter(f,true);// 通过子类实例化对象 //设置append为false
        // 进行写操作
        String s = "\r\n烟村四五家";
        writer.write(s);
        // 关闭输出流
        writer.close();
    }
}
